package com.example.pattern.strategy;

/**
 * 环境类（Context）
 *
 * @author FM_南风
 * @date 2024/7/3
 */
public class Sorter {
	private SortingStrategy strategy;

	public Sorter(SortingStrategy strategy) {
		this.strategy = strategy;
	}

	public void setStrategy(SortingStrategy strategy) {
		this.strategy = strategy;
	}

	public void performSort(int[] data) {
		strategy.sort(data);
	}
}
